1. Field of Invention
The invention relates to the technology associated with image processing, and more particularly to a method for increasing operation speed in virtual 3D application.
2. Related Art
Recently, the technology is advanced. So, a conventional game console having a flat image display is gradually replaced with another game console with 3D image processing. FIG. 1 is a schematic illustration showing a concept of simple 3D image processing applied to a conventional game console. As shown in FIG. 1, a tile 11 on the floor in a lower portion of a frame 101 is larger than a tile 12 in an upper portion of the frame 101 so that the distance difference can be seen from the drawing. Correspondingly, a user (player) can imagine that he or she stands on the floor at the lower portion of the frame and looks forwards. Basically, the concept of this virtual 3D image processing is to achieve the effect of simulating the floor in the 3D space according to the two-dimensional (2D) plane by adjusting the scaling ratio of each scan line.
In order to achieve the above-mentioned effects, graphic data, such as a map, previously stored in a memory is rotated and scaled, and then projected onto a display frame according to the following equation:
            [                                    X                                                Y                              ]        ⁢                                                      =                                                          =                                      ⁡                  [                                                                      w                  ×                  cos                  ⁢                                                                          ⁢                  θ                                                                                                  -                    w                                    ×                  sin                  ⁢                                                                          ⁢                  θ                                                                                                      w                  ×                  sin                  ⁢                                                                          ⁢                  θ                                                                              w                  ×                  cos                  ⁢                                                                          ⁢                  θ                                                              ]                    ⁡              [                                                                              X                  ′                                -                X_Off                                                                                                          Y                  ′                                -                Y_Off                                                    ]              ⁢                                        +                                                +                              ⁡              [                                            Tx_X                                                          Tx_Y                                      ]              ,wherein X′ and Y′ are pixels on the display screen; X and Y are coordinates of the map; X_Off, Y_Off, Tx_X and Tx_Y are parameters that may be adjusted by the user (e.g., Tx_X and Tx_Y may correspond to an object, such as a racing car, operated by the user); w is a scaling parameter; and cos θ and sin θ are rotation parameters.
If the frame of the game console has the standard VGA resolution (640×480), X′ ranging from 0 to 639 and Y′ ranging from 0 to 479 have to be substituted into the equation so that the pixel of the screen corresponding to the coordinates of each pixel of the map can be obtained.
The scaling parameter w has a very large fluctuating range. Generally speaking, the scaling parameter w on the uppermost portion of the frame is very large and typically has about 17 bits, and the scaling parameter w on the bottommost portion of the frame is very small and typically has about 8 bits. So, when a virtual 3D processor is being designed, a 17-bit multiplier has to be built in the hardware thereof. In general, the lower portion of the frame corresponds to the scene closer to the operated object, while the upper portion of the frame corresponds to the scene farther from the operated object. In other words, a clearer frame having the higher resolution is needed in the lower portion of the frame, while the clearer frame is not needed in the upper portion of the frame. That is, the upper portion of the frame only needs to have the lower resolution.
However, the above-mentioned design has a very great drawback. The lower portion of the frame only can have the 8-bit resolution, but the upper portion of the frame, which does not need the so-high resolution because the scene is far and is scaled down a lot, has the 17-bit resolution. Therefore, the display effect will not become better, but the required hardware multiplier has to be the 17-bit multiplier. If the number of bits of the multiplier is too great, the number of required clocks is increased so that the overall operation speed is slowed down. Meanwhile, the area required by the integrated circuit is increased, a lot of hardware cost may be increased correspondingly.